import request from "@/utils/http";
export const getTestAPI = () => {
  return request({
    url: "/test",
    method: "GET",
  });
};
export const postTestAPI = (index) => {
  return request({
    url: `/test`,
    method: "POST",
    data: {
      id: `${index}`,
      title: "post 000",
      items: [1, 2, 3],
    },
  });
};
export const putTestAPI = (index) => {
  return request({
    url: `/test/${index}`,
    method: "PUT",
    data: {
      id: `${index}`,
      items: [1, 2],
    },
  });
};
export const patchTestAPI = (index) => {
  return request({
    url: `/test/${index}`,
    method: "patch", // 使用 patch 而不是 put
    data: {
      title: "标题",
      items: [1, 2],
    },
  });
};
export const deleteTestAPI = (index) => {
  console.log(index);

  return request({
    url: `/test/${index}`,
    method: "delete", // 使用 patch 而不是 put
  });
};
